<?php
/**
* Author: Porlock
* Link: www.porlockz.com
* Date: 2018-03-30 16:32:43
* Last Modified time: 
* 1.未登录时，引入未登录header
* 2.登陆后，引入已注册header
* —————————————未完成—————————————
*/
session_start();
require_once ('init.php');
if(isset($_SESSION['uid'])){
	require_once ('includes/views/logined_header.php');
}
else{
	require_once ('includes/views/header.php');
}
//首页
if(@$_GET['action'] == ''){
	require_once ('members/countdown.php');
}
//公告
elseif (@$_GET['action'] == 'announcement'){
	require_once ('members/announcement.php');
	echo <<<EOT
	<script type="text/javascript">
		$("#home").removeClass("active");
		$("#announcement").addClass("active");
	</script>
EOT;
}
//赛题
elseif (@$_GET['action'] == 'challenge'){
    require_once ('members/challenge.php');
    echo <<<EOT
	<script type="text/javascript">
		$("#home").removeClass("active");
		$("#challenge").addClass("active");
	</script>
EOT;
}
//排行
elseif (@$_GET['action'] == 'rank'){
	require_once ('members/rank.php');
	echo <<<EOT
	<script type="text/javascript">
		$("#home").removeClass("active");
		$("#rank").addClass("active");
	</script>
EOT;
}
//关于
elseif (@$_GET['action'] == 'about'){
	require_once ('members/about.php');
	echo <<<EOT
	<script type="text/javascript">
		$("#home").removeClass("active");
		$("#about").addClass("active");
	</script>
EOT;
}
//登录
elseif (@$_GET['action'] == 'login'){
    require_once ('members/login.php');
    echo <<<EOT
	<script type="text/javascript">
		$("#home").removeClass("active");
		$("#login").addClass("active");
	</script>
EOT;
}
//注册
elseif (@$_GET['action'] == 'register'){
    require_once ('members/register.php');
    echo <<<EOT
	<script type="text/javascript">
		$("#home").removeClass("active");
		$("#register").addClass("active");
	</script>
EOT;
}
// 个人页面
elseif (@$_GET['action'] == 'my'){
    require_once ('members/my.php');
}
//退出登录
elseif (@$_GET['action'] == 'logout'){
    unset($_SESSION['uid']);
    echo "<meta http-equiv=refresh content='0; url=/afctf/index.php'>";
}
require_once ('includes/views/footer.php');

